package com.seventh.associationsystem.repository;

import com.seventh.associationsystem.bean.Announcement;
import com.seventh.associationsystem.bean.Association;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface AnnouncementRepository extends JpaRepository<Announcement, String>, JpaSpecificationExecutor<Announcement> {
    Announcement findByUid(String uid);

    Page<Announcement> findByAssociation(Association association, Pageable pageable);

    List<Announcement> findByAssociation(Association association);
}
